package com.car.service.impl;

import com.car.mapper.SysMenuMapper;
import com.car.pojo.Menu;
import com.car.service.SysMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysMenuServiceImpl implements SysMenuService {

    @Autowired
    private SysMenuMapper sysMenuMapper;
    @Override
    public List<Menu> list(Menu menu, Integer pageSize, Integer pageNo) {
        Integer startIndex = (pageNo-1) * pageSize;
        return sysMenuMapper.list(menu, startIndex, pageNo);
    }

    @Override
    public Integer selectSysUserCount(Menu menu) {
        return sysMenuMapper.selectSysUserCount(menu);
    }

    @Override
    public Integer add(Menu menu) {
        return sysMenuMapper.add(menu);
    }

    @Override
    public int delete(Integer menu_id) {
        return sysMenuMapper.delete(menu_id);
    }

    @Override
    public int update(Menu menu) {
        return sysMenuMapper.update(menu);
    }

    @Override
    public Menu getByid(Integer menu_id) {
        return sysMenuMapper.getByid(menu_id);
    }
}
